#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int i = 1, n = 0;
	int all = 1;
	scanf("%d", &n);
	int arr[10000];
	scanf("%d", &arr[1]);
	for (int t = 2; t <= n; t++)
	{
		scanf("%d", &arr[t]);
		if (arr[t] - 1 != arr[t-1])
			i = 1;
		else
			i++;
		if (i > all)
			all = i;
	}
	printf("%d", all);
	return 0;
}